package cn.cyejing.ngrok.core;

import java.util.Scanner;

public class NgrokClientMain {

    private static final String serverAddress = "ngrok.ifafe.com";
    private static final int serverPort = 4443;

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        System.out.println("请输入域名前缀.");
        String subDomain = sc.nextLine();

        System.out.println("请输入映射端口.");
        int port = sc.nextInt();

        Tunnel tunnel = new Tunnel.TunnelBuild().setPort(port).setProto("http").setSubDomain(subDomain).build();
        new NgrokClient(serverAddress, serverPort).addTunnel(tunnel).start();
    }

}
